package com.caregiver.watch.business.user.enums;

import lombok.Getter;

/**
 * 用户与被照护人关系枚举
 */
@Getter
public enum CareRelationshipEnum {
    /**
     * 自己
     */
    SELF("自己", "/self.png"),
    
    /**
     * 爸爸
     */
    FATHER("爸爸", "/father.png"),
    
    /**
     * 妈妈
     */
    MOTHER("妈妈", "/mother.png"),
    
    /**
     * 爷爷
     */
    GRANDFATHER("爷爷", "/grandfather.png"),
    
    /**
     * 奶奶
     */
    GRANDMOTHER("奶奶", "/grandmother.png"),
    
    /**
     * 外公
     */
    MATERNAL_GRANDFATHER("外公", "/maternal-grandfather.png"),
    
    /**
     * 外婆
     */
    MATERNAL_GRANDMOTHER("外婆", "/maternal-grandmother.png"),
    
    /**
     * 老公
     */
    HUSBAND("老公", "/husband.png"),
    
    /**
     * 老婆
     */
    WIFE("老婆", "/wife.png"),
    
    /**
     * 儿子
     */
    SON("儿子", "/son.png"),
    
    /**
     * 女儿
     */
    DAUGHTER("女儿", "/daughter.png"),
    
    /**
     * 其他
     */
    OTHER("其他", "/other.png");

    private final String description;
    /**
     * 头像
     */
    private final String avatar;

    CareRelationshipEnum(String description, String avatar) {
        this.description = description;
        this.avatar = avatar;
    }

    /**
     * 根据描述获取枚举
     * @param relationship
     * @return CareRelationshipEnum
     */
    public static CareRelationshipEnum parse(String relationship) {
        for (CareRelationshipEnum relationshipEnum : CareRelationshipEnum.values()) {
            if (relationshipEnum.name().equals(relationship)) {
                return relationshipEnum;
            }
        }
        return OTHER;
    }

    @Override
    public String toString() {
        return description;
    }
}
